<!DOCTYPE html>
<html>
<head>
    <title>运单修改</title>
    <meta charset=utf-8>
    <meta name=viewport content="width=device-width, initial-scale=1">
    <link rel="stylesheet" type="text/css" href="../../../../start/layui/css/layui.css">
    <script type="text/javascript" src="../../../../start/layui/layui.js"></script>

</head>
<body>
<!--第二部分总体设置-->
<form class="layui-form" action="hahahaha">
    <div class="layui-row" style="margin-top:20px">
        <div class="layui-col-xs2">
            <div class="grid-demo grid-demo-bg1">
                <div class="layui-inline">
                    <label class="layui-form-label">托运单号：</label>
                    <div class="layui-input-inline" style="width:100px;">
                        <input disabled="disabled" type="text" name="checkenumber" id="checkenumber"  placeholder="" autocomplete="off" class="layui-input">
                    </div>
                </div>
            </div>
        </div>
        <div class="layui-col-xs2">
            <div class="grid-demo">
                <div class="layui-inline">
                    <label class="layui-form-label">运单日期：</label>
                    <div class="layui-input-block" style="width:100px;">
                        <input type="text" name="checkedate" id="checkedate" autocomplete="off" class="layui-input">
                    </div>
                </div>
            </div>
        </div>
        <div class="layui-col-xs2">
            <div class="grid-demo grid-demo-bg1">
                <div class="layui-inline">
                    <label class="layui-form-label">运单状态：</label>
                    <div class="layui-input-inline" style="width:100px;">
                        <input type="text" name="yundanstate" id="yundanstate"  placeholder="" autocomplete="off" class="layui-input">
                    </div>
                </div></div>
        </div>
        <div class="layui-col-xs2">
            <div class="grid-demo">
                <div class="layui-inline">
                    <label class="layui-form-label">出发地：</label>
                    <div class="layui-input-inline" style="width:100px;">
                        <input disabled="disabled" type="text" name="departure" id="departure"  placeholder="" autocomplete="off" class="layui-input">
                    </div>
                </div>
            </div>
        </div>
        <div class="layui-col-xs2">
            <div class="grid-demo grid-demo-bg1">
                <div class="layui-inline">
                    <label class="layui-form-label">到达分站：</label>
                    <div class="layui-input-inline" style="width:100px;">
                        <input disabled="disabled" type="text" name="arrivesubstations" id="arrivesubstations"  placeholder="" autocomplete="off" class="layui-input">
                    </div>
                </div>
            </div>
        </div>
        <div class="layui-col-xs2">
            <div class="grid-demo">
                <div class="layui-inline">
                    <label class="layui-form-label">到达城市：</label>
                    <div class="layui-input-inline" style="width:100px;">
                        <input disabled="disabled" type="text" name="arrivecity" id="arrivecity"  placeholder="" autocomplete="off" class="layui-input">
                    </div>
                </div></div>
        </div>
    </div>
    <hr class="layui-border-cyan">
    <div style="width: 100%;height: 40px;">
        <dd style="text-align-last: center;font-size:16px;">基本信息</dd>
    </div>
    <hr class="layui-border-cyan">
    <div class="layui-row" style="margin-top:10px">
        <div class="layui-col-xs3">
            <div class="grid-demo grid-demo-bg1">
                <div class="layui-inline">
                    <label class="layui-form-label">发货单位：</label>
                    <div class="layui-input-inline" style="width:160px;">
                        <input type="text" name="shippingunits" id="shippingunits"  placeholder="请输入" autocomplete="off" class="layui-input">
                    </div>
                </div>
            </div>
        </div>
        <div class="layui-col-xs3">
            <div class="grid-demo">
                <div class="layui-inline">
                    <label class="layui-form-label">发货人：</label>
                    <div class="layui-input-inline" style="width:160px;">
                        <input type="text" name="consigners" id="consigners"  placeholder="请输入" autocomplete="off" class="layui-input">
                    </div>
                </div>
            </div>
        </div>
        <div class="layui-col-xs3">
            <div class="grid-demo grid-demo-bg1">
                <div class="layui-inline">
                    <label class="layui-form-label">发货地址：</label>
                    <div class="layui-input-inline" style="width:210px;">
                        <input disabled="disabled" type="text" name="shippingaddress" id="shippingaddress"  placeholder="请输入" autocomplete="off" class="layui-input">
                    </div>
                </div>
            </div>
        </div>
        <div class="layui-col-xs3">
            <div class="grid-demo">
                <div class="layui-inline">
                    <label class="layui-form-label">联系电话：</label>
                    <div class="layui-input-inline" style="width:160px;">
                        <input type="text" name="shippingphone" id="shippingphone"  placeholder="请输入" autocomplete="off" class="layui-input">
                    </div>
                </div>
            </div>
        </div>
    </div>
    <div class="layui-row" style="margin-top:10px">
        <div class="layui-col-xs3">
            <div class="grid-demo grid-demo-bg1"><div class="layui-inline">
                <label class="layui-form-label">收货单位：</label>
                <div class="layui-input-inline" style="width:160px;">
                    <input type="text" name="receivingunit" id="receivingunit"  placeholder="请输入" autocomplete="off" class="layui-input">
                </div>
            </div></div>
        </div>
        <div class="layui-col-xs3">
            <div class="grid-demo"><div class="layui-inline">
                <label class="layui-form-label">收货人：</label>
                <div class="layui-input-inline" style="width:160px;">
                    <input type="text" name="consignees" id="consignees"  placeholder="请输入" autocomplete="off" class="layui-input">
                </div>
            </div></div>
        </div>
        <div class="layui-col-xs3">
            <div class="grid-demo grid-demo-bg1"><div class="layui-inline">
                <label class="layui-form-label">收货地址：</label>
                <div class="layui-input-inline" style="width:210px;">
                    <input disabled="disabled" type="text" name="receiptaddress" id="receiptaddress"  placeholder="请输入" autocomplete="off" class="layui-input">
                </div>
            </div></div>
        </div>
        <div class="layui-col-xs3">
            <div class="grid-demo"><div class="layui-inline">
                <label class="layui-form-label">联系电话：</label>
                <div class="layui-input-inline" style="width:160px;">
                    <input type="text" name="receivingphone" id="receivingphone"  placeholder="请输入" autocomplete="off" class="layui-input">
                </div>
            </div></div>
        </div>
    </div>
    <hr class="layui-border-cyan">
    <div style="width: 100%;height: 40px;">
        <dd style="text-align-last: center;font-size:16px;">货运信息</dd>
    </div>
    <hr class="layui-border-cyan">
    <div class="layui-row" style="margin-top:10px">
        <div class="layui-col-xs3">
            <div class="grid-demo grid-demo-bg1"><div class="layui-inline">
                <label class="layui-form-label">送货方式：</label>
                <div class="layui-input-inline" style="width:160px;">
                    <select name="deliverymethod" id="deliverymethod"  lay-search="">
                        <option value="等通知提">等通知提</option>
                        <option value="自提">自提</option>
                        <option value="等通知送">等通知送</option>
                    </select>
                </div>
            </div></div>
        </div>
        <div class="layui-col-xs3">
            <div class="grid-demo"><div class="layui-inline">
                <label class="layui-form-label">运输类型：</label>
                <div class="layui-input-inline" style="width:160px;">
                    <select name="transporttype" id="transporttype"  lay-search="">
                        <option value="普通运输">普通运输</option>
                        <option value="加急卡班">加急卡班</option>
                        <option value="整车运输">整车运输</option>
                        <option value="航空运输">航空运输</option>
                        <option value="铁路运输">铁路运输</option>
                        <option value="冷链运输">冷链运输</option>
                    </select>
                </div>
            </div></div>
        </div>
        <div class="layui-col-xs3">
            <div class="grid-demo grid-demo-bg1"><div class="layui-inline">
                <label class="layui-form-label">承诺日期：</label>
                <div class="layui-input-block" style="width:160px;">
                    <input type="text" name="promisedate" id="promisedate" autocomplete="off" class="layui-input">
                </div>
            </div></div>
        </div>
        <div class="layui-col-xs3">
            <div class="grid-demo"><div class="layui-inline">
                <label class="layui-form-label">订单编号：</label>
                <div class="layui-input-inline" style="width:160px;">
                    <input type="text" name="ordersnumber" id="ordersnumber"  placeholder="请输入" autocomplete="off" class="layui-input">
                </div>
            </div></div>
        </div>
    </div>
    <div class="layui-row" style="margin-top:10px">
        <div class="layui-col-xs3">
            <div class="grid-demo grid-demo-bg1"><div class="layui-inline">
                <label class="layui-form-label">货物名称：</label>
                <div class="layui-input-inline" style="width:160px;">
                    <input type="text" name="goodsname" id="goodsname"  placeholder="请输入" autocomplete="off" class="layui-input">
                </div>
            </div></div>
        </div>
        <div class="layui-col-xs3">
            <div class="grid-demo"><div class="layui-inline">
                <label class="layui-form-label">数量：</label>
                <div class="layui-input-inline" style="width:160px;">
                    <input type="text" name="goodsquantity" id="goodsquantity" placeholder="请输入" autocomplete="off" class="layui-input">
                </div>
            </div></div>
        </div>
        <div class="layui-col-xs3">
            <div class="grid-demo grid-demo-bg1"><div class="layui-inline">
                <label class="layui-form-label">包装方式：</label>
                <div class="layui-input-inline" style="width:160px;">
                    <select name="wrapmanner" id="wrapmanner" lay-search="">
                        <option value="1">纸箱</option>
                        <option value="2">木箱</option>
                        <option value="3">托盘</option>
                        <option value="4">桶装</option>
                        <option value="5">裸装</option>
                        <option value="6">袋装</option>
                        <option value="7">缠绕膜</option>
                        <option value="8">其它</option>
                    </select>
                </div>
            </div></div>
        </div>
        <div class="layui-col-xs3">
            <div class="grid-demo"><div class="layui-inline">
                <label class="layui-form-label">重量：</label>
                <div class="layui-input-inline" style="width:160px;">
                    <input type="text" name="goodsweight" id="goodsweight" placeholder="请输入" autocomplete="off" class="layui-input">
                </div>
            </div></div>
        </div>
    </div>
    <div class="layui-row" style="margin-top:10px">
        <div class="layui-col-xs3">
            <div class="grid-demo grid-demo-bg1"><div class="layui-inline">
                <label class="layui-form-label">体积：</label>
                <div class="layui-input-inline" style="width:160px;">
                    <input type="text" name="goodsvolume" id="goodsvolume" placeholder="请输入" autocomplete="off" class="layui-input">
                </div>
            </div></div>
        </div>
        <div class="layui-col-xs3">
            <div class="grid-demo"><div class="layui-inline">
                <label class="layui-form-label">单价：</label>
                <div class="layui-input-inline" style="width:160px;">
                    <input type="text" name="goodsunitprice" id="goodsunitprice" placeholder="请输入" autocomplete="off" class="layui-input">
                </div>
            </div></div>
        </div>
        <div class="layui-col-xs3">
            <div class="grid-demo grid-demo-bg1"><div class="layui-inline">
                <label class="layui-form-label">计费方式：</label>
                <div class="layui-input-inline" style="width:160px;">
                    <select name="billingmanner" id="billingmanner" lay-search="">
                        <option value="weight">重量</option>
                        <option value="volume">体积</option>
                        <option value="number">件数</option>
                    </select>
                </div>
            </div></div>
        </div>
        <div class="layui-col-xs3">
            <div class="grid-demo"><div class="layui-inline">
                <label class="layui-form-label">基本运费：</label>
                <div class="layui-input-inline" style="width:160px;">
                    <input type="text" name="basicfreight" id="basicfreight" placeholder="请输入" autocomplete="off" class="layui-input">
                </div>
            </div></div>
        </div>
    </div>
    <div class="layui-row" style="margin-top:10px">
        <div class="layui-col-xs3">
            <div class="grid-demo grid-demo-bg1"><div class="layui-inline">
                <label class="layui-form-label">提货费：</label>
                <div class="layui-input-inline" style="width:160px;">
                    <input type="text" name="pickupfee" id="pickupfee"  placeholder="请输入" autocomplete="off" class="layui-input">
                </div>
            </div></div>
        </div>
        <div class="layui-col-xs3">
            <div class="grid-demo"><div class="layui-inline">
                <label class="layui-form-label">送货费：</label>
                <div class="layui-input-inline" style="width:160px;">
                    <input type="text" name="deliveryfees" id="deliveryfees"  placeholder="请输入" autocomplete="off" class="layui-input">
                </div>
            </div></div>
        </div>
        <div class="layui-col-xs3">
            <div class="grid-demo grid-demo-bg1"><div class="layui-inline">
                <label class="layui-form-label">货物价值：</label>
                <div class="layui-input-inline" style="width:160px;">
                    <input type="text" name="goodsvalue" id="goodsvalue"  placeholder="请输入" autocomplete="off" class="layui-input">
                </div>
            </div></div>
        </div>
        <div class="layui-col-xs3">
            <div class="grid-demo"><div class="layui-inline">
                <label class="layui-form-label">保价费用：</label>
                <div class="layui-input-inline" style="width:160px;">
                    <input type="text" name="goodsinsured" id="goodsinsured"  placeholder="请输入" autocomplete="off" class="layui-input">
                </div>
            </div></div>
        </div>
    </div>
    <div class="layui-row" style="margin-top:10px">
        <div class="layui-col-xs3">
            <div class="grid-demo grid-demo-bg1"><div class="layui-inline">
                <label class="layui-form-label">卸货费：</label>
                <div class="layui-input-inline" style="width:160px;">
                    <input type="text" name="unloadingfees" id="unloadingfees" placeholder="请输入" autocomplete="off" class="layui-input">
                </div>
            </div></div>
        </div>
        <div class="layui-col-xs3">
            <div class="grid-demo"><div class="layui-inline">
                <label class="layui-form-label">其它费用：</label>
                <div class="layui-input-inline" style="width:160px;">
                    <input type="text" name="otherfees" id="otherfees"  placeholder="请输入" autocomplete="off" class="layui-input">
                </div>
            </div></div>
        </div>
        <div class="layui-col-xs3">
            <div class="grid-demo grid-demo-bg1"><div class="layui-inline">
                <label class="layui-form-label">费用合：</label>
                <div class="layui-input-inline" style="width:160px;">
                    <input type="text" name="costcombined" id="costcombined"  placeholder="请输入" autocomplete="off" class="layui-input">
                </div>
            </div></div>
        </div>
        <div class="layui-col-xs3">
            <div class="grid-demo"><div class="layui-inline">
                <label class="layui-form-label">现付：</label>
                <div class="layui-input-inline" style="width:160px;">
                    <input type="text" name="payasyougo" id="payasyougo"  placeholder="请输入" autocomplete="off" class="layui-input">
                </div>
            </div></div>
        </div>
    </div>
    <div class="layui-row" style="margin-top:10px">
        <div class="layui-col-xs3">
            <div class="grid-demo grid-demo-bg1"><div class="layui-inline">
                <label class="layui-form-label">付款方式：</label>
                <div class="layui-input-inline" style="width:160px;">
                    <select name="paymentmethod" id="paymentmethod"  lay-search="">
                        <option value="1">现金</option>
                        <option value="2">支付宝</option>
                        <option value="3">微信</option>
                        <option value="3">银联汇款</option>
                        <option value="3">刷卡支付</option>
                    </select>
                </div>
            </div></div>
        </div>
        <div class="layui-col-xs3">
            <div class="grid-demo"><div class="layui-inline">
                <label class="layui-form-label">到付：</label>
                <div class="layui-input-inline" style="width:160px;">
                    <input type="text" name="paydelivery" id="paydelivery"  placeholder="请输入" autocomplete="off" class="layui-input">
                </div>
            </div></div>
        </div>
        <div class="layui-col-xs3">
            <div class="grid-demo grid-demo-bg1"><div class="layui-form-item layui-form-text" style="width:300px;">
                <label class="layui-form-label">货物备注</label>
                <div class="layui-input-block">
                    <textarea   style="height:30px;" name="goodsremarks" id="goodsremarks" placeholder="" class="layui-textarea"></textarea>
                </div>
            </div></div>
        </div>
        <div class="layui-col-xs3">
            <div class="grid-demo"><div class="layui-inline">
                <label class="layui-form-label">操作员：</label>
                <div class="layui-input-inline" style="width:160px;">
                    <input disabled="disabled" type="text" name="operateyuan" id="operateyuan"  placeholder="请输入" autocomplete="off" class="layui-input">
                </div>
            </div>
            </div>
        </div>
    </div>
    <hr class="layui-border-cyan">
    <div style="width: 100%;height: 40px;">
        <dd style="text-align-last: center;font-size:16px;">其它信息</dd>
    </div>
    <hr class="layui-border-cyan">

    <div class="layui-row" style="margin-top:10px">
        <div class="layui-col-xs3">
            <div class="grid-demo grid-demo-bg1"><div class="layui-inline">
                <label class="layui-form-label">运输单号：</label>
                <div class="layui-input-inline" style="width:160px;">
                    <input type="text" name="transportnumber" id="transportnumber"  placeholder="请输入" autocomplete="off" class="layui-input">
                </div>
            </div></div>
        </div>
        <div class="layui-col-xs3">
            <div class="grid-demo"><div class="layui-inline">
                <label class="layui-form-label">运输车号：</label>
                <div class="layui-input-inline" style="width:160px;">
                    <input type="text" name="transportcarnumber" id="transportcarnumber"  placeholder="请输入" autocomplete="off" class="layui-input">
                </div>
            </div></div>
        </div>
        <div class="layui-col-xs3">
            <div class="grid-demo grid-demo-bg1"><div class="layui-inline">
                <label class="layui-form-label">司机姓名：</label>
                <div class="layui-input-inline" style="width:160px;">
                    <input type="text" name="drivername" id="drivername"  placeholder="请输入" autocomplete="off" class="layui-input">
                </div>
            </div></div>
        </div>
        <div class="layui-col-xs3">
            <div class="grid-demo"><div class="layui-inline">
                <label class="layui-form-label">司机电话：</label>
                <div class="layui-input-inline" style="width:160px;">
                    <input type="text" name="driverphone" id="driverphone"  placeholder="请输入" autocomplete="off" class="layui-input">
                </div>
            </div>
            </div>
        </div>
    </div>

    <div class="layui-row" style="margin-top:10px">
        <div class="layui-col-xs3">
            <div class="grid-demo grid-demo-bg1"><div class="layui-inline">
                <label class="layui-form-label">发车时间：</label>
                <div class="layui-input-inline" style="width:160px;">
                    <input type="text" name="departuretime" id="departuretime"  placeholder="请输入" autocomplete="off" class="layui-input">
                </div>
            </div></div>
        </div>
        <div class="layui-col-xs3">
            <div class="grid-demo"><div class="layui-inline">
                <label class="layui-form-label">入库站点：</label>
                <div class="layui-input-inline" style="width:160px;">
                    <input type="text" name="storagesite" id="storagesite"  placeholder="请输入" autocomplete="off" class="layui-input">
                </div>
            </div></div>
        </div>
        <div class="layui-col-xs3">
            <div class="grid-demo grid-demo-bg1"><div class="layui-inline">
                <label class="layui-form-label">外包单号：</label>
                <div class="layui-input-inline" style="width:160px;">
                    <input type="text" name="outsourcingnumber" id="outsourcingnumber"  placeholder="请输入" autocomplete="off" class="layui-input">
                </div>
            </div></div>
        </div>
        <div class="layui-col-xs3">
            <div class="grid-demo"><div class="layui-inline">
                <label class="layui-form-label">外包公司：</label>
                <div class="layui-input-inline" style="width:160px;">
                    <input type="text" name="outsourcingcompany" id="outsourcingcompany"  placeholder="请输入" autocomplete="off" class="layui-input">
                </div>
            </div>
            </div>
        </div>
    </div>

    <div class="layui-row" style="margin-top:10px">
        <div class="layui-col-xs3">
            <div class="grid-demo grid-demo-bg1"><div class="layui-inline">
                <label class="layui-form-label">外包电话：</label>
                <div class="layui-input-inline" style="width:160px;">
                    <input type="text" name="outsourcephone" id="outsourcephone"  placeholder="请输入" autocomplete="off" class="layui-input">
                </div>
            </div></div>
        </div>
        <div class="layui-col-xs3">
            <div class="grid-demo"><div class="layui-inline">
                <label class="layui-form-label">转包日期：</label>
                <div class="layui-input-block" style="width:160px;">
                    <input type="text" name="subcontractingdate" id="subcontractingdate" autocomplete="off" class="layui-input">
                </div>
            </div></div>
        </div>
        <div class="layui-col-xs3">
            <div class="grid-demo grid-demo-bg1"><div class="layui-inline">
                <label class="layui-form-label">外包运费：</label>
                <div class="layui-input-inline" style="width:160px;">
                    <input type="text" name="outsourcedfreight" id="outsourcedfreight"  placeholder="请输入" autocomplete="off" class="layui-input">
                </div>
            </div></div>
        </div>
        <div class="layui-col-xs3">
            <div class="grid-demo"><div class="layui-inline">
                <label class="layui-form-label">外包类型：</label>
                <div class="layui-input-inline" style="width:160px;">
                    <input type="text" name="outsourcingtype" id="outsourcingtype"  placeholder="请输入" autocomplete="off" class="layui-input">
                </div>
            </div>
            </div>
        </div>
    </div>
    <div class="layui-row" style="margin-top:10px">
        <div class="layui-col-xs12">
            <div class="grid-demo grid-demo-bg1">
                <button style="margin-left:80%;" class="layui-btn" lay-submit lay-filter="formDemo" style="align-items: center">提交修改</button>
                <button type="reset" class="layui-btn layui-btn-primary" style="align-items: center">重置</button>
            </div>
        </div>
    </div>
</form>
</body>
<script>
    layui.use(['form', 'layedit', 'laydate','table'], function(){
        var form = layui.form
            ,layer = layui.layer
            ,layedit = layui.layedit
            ,laydate = layui.laydate
            ,table = layui.table;
        var $ = layui.jquery;

        //监听提交：提交事件
        form.on('submit(formDemo)', function(data){
            $.ajax({
                type:'post'
                ,url:'../../../../updateDeparturelist'
                ,data:data.field
                ,success:function(obj) {
                    if(obj.length>0){
                        parent.layer.close(1); //再执行关闭
                        //修改成功后刷新父界面
                        window.parent.location.reload();
                    }
                }
            });
            layer.msg(JSON.stringify(data.field));
            return false;
        });

        $(function(){
            $("#costcombined").mouseleave(function(){
                //得到数量文本框的值
                var goodsquantity = $("#goodsquantity").prop("value");
                //得到第重量文本框的值
                var goodsweight = $("#goodsweight").prop("value");
                //得到第体积文本框的值
                var goodsvolume = $("#goodsvolume").prop("value");
                //得到第单价文本框的值
                var goodsunitprice = $("#goodsunitprice").prop("value");
                //得到用户选择的计费方式
                var billingmanner = $("#billingmanner").prop("value");
                //定义一个空的变量用于存储计算结果
                var price=0;
                //通过获得方法的参用于进行判断
                if(billingmanner == "weight"){
                    //将priceone和pricetwo的数据类型定义为Int
                    price = (parseInt(goodsweight)*parseInt(goodsunitprice))*parseInt(goodsquantity);
                    alert("计费方式重量");
                }else if(ginseng == "volume"){
                    price = (parseInt(goodsvolume)*parseInt(goodsunitprice))*parseInt(goodsquantity);
                    alert("计费方式体积");
                }else if(ginseng == "number"){
                    price = parseInt(goodsquantity)*parseInt(goodsunitprice);
                    alert("计费方式件数");
                }
                $("#costcombined").prop('value',price);
            });
        });

        laydate.render({
            elem: '#date'
        });
        laydate.render({
            elem: '#checkedate'
        });
        laydate.render({
            elem: '#promisedate'
        });
        laydate.render({
            elem: '#departuretime'
        });
        laydate.render({
            elem: '#subcontractingdate'
        });
    });
</script>
</html>